<script setup lang="ts">
  import { useI18n } from '/@/hooks/web/useI18n';
  import { BasicColumn, BasicTable, useTable } from '/@/components/Table';
  import { wzyjListData } from '/@/api/cardd/yxyj/carddClyj';

  const { t } = useI18n('cardd.wzjl.coreClwzjl');

  const tableColumns: BasicColumn[] = [
    {
      title: t('车牌号'),
      dataIndex: 'carCode',
      key: 'a.carCode',
      sorter: false,
      width: 80,
      align: 'left',
    },
    {
      title: t('品牌型号'),
      dataIndex: 'carType',
      key: 'a.carType',
      sorter: false,
      width: 80,
      align: 'left',
      dictType: 'car_type',
    },
    {
      title: t('驾驶员'),
      dataIndex: 'driverName',
      key: 'a.driverName',
      sorter: false,
      width: 130,
      align: 'left',
    },
    {
      title: t('违章日期'),
      dataIndex: 'ddate',
      key: 'a.ddate',
      sorter: false,
      width: 130,
      align: 'left',
    },
  ];

  const actionColumn: BasicColumn = {
    width: 60,
    actions: (record: Recordable) => [
      {
        icon: 'i-clarity:note-edit-line',
        title: t('编辑车辆违章记录'),
        // onClick: handleForm.bind(this, { id: record.id }),
        auth: 'cardd:wzjl:coreClwzjl:edit',
      },
    ],
  };

  const [registerTable] = useTable({
    api: wzyjListData,
    beforeFetch: (params) => {
      return params;
    },
    columns: tableColumns,
    // actionColumn: actionColumn,
    showTableSetting: false,
    useSearchForm: false,
    canResize: true,
    maxHeight: 250,
    pagination: false,
    showIndexColumn: false,
  });
</script>

<template>
  <div>
    <BasicTable @register="registerTable" />
  </div>
</template>

<style scoped lang="less"></style>
